#pragma once

#include "gameobject.h"
#include "HeatPhysics.h"
#include "../SGD Wrappers/SGD_Math.h"

class IceLayer : public GameObject, public HeatPhysics
{
public:

	struct SlidingObject
	{
		GameObject* object;
		tVector2D current;
		tVector2D previous;
		float delta;
		bool gotDelta;
		int collided;
		bool wasMoved;
	};

private:

	static int iceCount;
	static int iceCounter;
	bool isFrozen;
	int puddleImageID;
	float slideSpeed;

	static vector<SlidingObject> slidingObjects;

public:
	// Constructor
	IceLayer(void);

	// Destructor
	~IceLayer(void);

	//////////////////////////////////////////////////
	// GameObject Methods:
	void Update(float deltaTime);
	void Render(void) const;
	void HandleCollision(GameObject& other, CollisionInfo& info);
	void ResetToCheckPoint();

	//////////////////////////////////////////////////
	// Accessors:
	bool IsFrozen(void) const { return isFrozen; }
	float GetSlideSpeed(void) const { return slideSpeed; }

	static inline vector<SlidingObject>& GetSlidingObjects(void) { return slidingObjects; }

	//////////////////////////////////////////////////
	// Mutators:
	void SetPuddleImageID(int id);
	void SetSlideSpeed(float speed);
};

